package com.web.mapper;

import com.web.entity.DietRecord;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * 饮食记录
 */
@Mapper
public interface DietRecordMapper {

    @MapKey("recordDate")
    public List<Map<String,Object>> findByUserIdAndDate(Integer userId);

    public List<DietRecord> getByUserIdAndDate(DietRecord dietRecord);

    //增加饮食记录
    void insert(DietRecord dietRecord);

    //根据id删除饮食记录
    void deleteById(int id);

    //根据id修改饮食记录
    void updateById(DietRecord dietRecord);

    //根据id查询饮食记录
    DietRecord selectById(int id);

    //查询所有饮食记录
    List<DietRecord> selectAll();



}
